package com.example.ByteStream;

import java.io.FileNotFoundException;
import java.io.PrintWriter;

/**
 * @author Jason
 * @PACKAGE_NAME com.example.ByteStream
 * @Description PrintWriter使用
 * @date 2023-12-13 14:12
 */
public class PrintWriterDemo {
    public static void main(String[] args) throws FileNotFoundException {
        //1.创建打印流
        PrintWriter pw = new PrintWriter("d:\\bbb.txt");

        //2.写入
        pw.println("hello");
        pw.println(97);
        pw.print(3.1415926);
        pw.println('a');
        
        int a = 10;
        char b = 'A';
        double c = 123.001;
        pw.format("aaa %d %s %f", a, b, c);

        //3.关闭
        pw.close();

    }
}
